{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1b3eea33",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('10001', '10002', '10003') <class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "# 元组(tuple)\n",
    "\n",
    "stu_id = \"10001\",\"10002\",\"10003\"\n",
    "print(stu_id,type(stu_id))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41c9a78e",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_id "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a8cff0ce",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4a5dd153",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5ff01579",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stud_10001': 'Alex', 'stud_10002': 'Jack', 'stud_10003': 'Mary'}"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 字典\n",
    "# 1.创建字典的三种常见的方法\n",
    "# 直接按照字典的格式创建：[key1:value1,key2:value2,...]\n",
    "\n",
    "stud_info = {\n",
    "    \"stud_10001\":\"Alex\",\n",
    "    \"stud_10002\":\"Jack\",\n",
    "    \"stud_10003\":\"Mary\"\n",
    "}\n",
    "stud_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "716c70ba",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stud_10001': 'Alex', 'stud_10002': 'Jack', 'stud_10003': 'Mary'}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# dict()函数来创建字典：dict()\n",
    "stud_info_02 = dict(\n",
    "    stud_10001 = \"Alex\",\n",
    "    stud_10002 = \"Jack\",\n",
    "    stud_10003 = \"Mary\"\n",
    ")\n",
    "stud_info_02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "344e4b11",
   "metadata": {},
   "outputs": [],
   "source": [
    "stud_info_03 = {}\n",
    "stud_info_03[\"stud_10001\"] = \"Alex\"\n",
    "stud_info_03[\"stud_10002\"] = \"Jack\"\n",
    "stud_info_03[\"stud_10003\"] = \"Mary\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "4fe23251",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stud_10001': 'Alex', 'stud_10002': 'Jack', 'stud_10003': 'Mary'}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stud_info_03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "05247240",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['stud_10001', 'stud_10002', 'stud_10003'])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stud_info_03.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dc4f7502",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
